#!/usr/bin/bash
# Xyzzy installer 1.0.4.5
# This program is free software is under the ISC Licence. See COPYING for more information.
echo "Are you sure you want to install Mahaer Mahmud's xyzzy script?"
read -r -p '[y/n] ' prompt # yes/no option
prompt=${prompt,,}  # allows options in lowercase
if [[ "$prompt" =~ ^(yes|y)$ ]] # if the prompt is yes, y, Y, etc.
then 
sudo cp -f xyzzy /usr/bin/xyzzy # installs the script itself
sudo mkdir /usr/share/doc/xyzzy/ # makes documentation folder
sudo cp -f README.md /usr/share/doc/xyzzy/ # copies README to the documentation folder
sudo mkdir /usr/share/licenses/xyzzy/ # makes licence folder
sudo cp -f COPYING /usr/share/licenses/xyzzy/ # installs the licence
echo 'You have sucessfully installed the program.'
else
echo 'You have cancelled installation.'
fi # closes script
